from django import forms
from pyceab.course.models import Course
from pyceab.plan.models import PlannedCourse, TERMS

class PlannedCourseForm(forms.ModelForm):
    class Meta:
        model = PlannedCourse

all_courses = Course.objects.all()
departments = set([course.department for course in all_courses])
departments = sorted(list(departments))
DEPARTMENT_CHOICES = zip(departments, departments) 
DEPARTMENT_CHOICES.insert(0, ('', '----'))

class CourseSearchForm(forms.Form):
    department = forms.ChoiceField(choices=DEPARTMENT_CHOICES, required=False)
    course_code = forms.CharField(max_length=5, required=False)
    full_name = forms.CharField( label="Course Name", required=False)
    te_sci = forms.BooleanField(label="Has Science hours", required=False)
    te_engdes = forms.BooleanField(label="Has Engineering Design hours", required=False)
    te_engsci = forms.BooleanField(label="Has Engineering Science hours", required=False)
    te_math = forms.BooleanField(label="Has Math hours", required=False)
    cse_a = forms.BooleanField(label="Is List A CSE", required=False)
    cse_b = forms.BooleanField(label="Is List B CSE", required=False)
    cse_c = forms.BooleanField(label="Is List C CSE", required=False)
    cse_d = forms.BooleanField(label="Is List D CSE", required=False)
